﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

/// <summary>
/// Summary description for Configuration
/// </summary>
public class PAConfiguration
{
	public static string ConnectionString
	{
		get
		{
			return System.Configuration.ConfigurationManager.ConnectionStrings["MainConnectionString"].ConnectionString;
		}
	}


	public static string NoConnectionMessage
	{
		get
		{
			return System.Configuration.ConfigurationManager.AppSettings["NoConnectionMessage"];
		}
	}


	public static bool HideProfile
	{
		get
		{
			return bool.Parse(System.Configuration.ConfigurationManager.AppSettings["HideProfile"]);
		}
	}

	public static bool IsSuperUser(Decimal userId)
	{
		string[] userIds = System.Configuration.ConfigurationManager.AppSettings["SuperUsers"].Split(',');

		foreach (string suserId in userIds)
		{
			if (decimal.Parse(suserId) == userId)
				return true;
		}

		return false;
	}
}
